package com.dp.service.impl;

import org.springframework.stereotype.Service;

import com.dp.service.impl3.BaseImpl;
import com.dp.vo.TWeatherdetail;
import com.dp.vo.TWeatherdetailPK;

@Service
public class WeatherDetailServiceImpl extends BaseImpl {

	
	public void save(TWeatherdetail button) {
		try {
		if (button == null) {
			// new
			em.persist(button);
		} else {
			// update
			em.merge(button);
		}
		em.flush();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void remove(TWeatherdetailPK tWeatherdetailPK) {
		try {
		TWeatherdetail button = find(tWeatherdetailPK);
		if (button != null) {
			em.remove(button);
		}
		em.flush();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public TWeatherdetail find(TWeatherdetailPK tWeatherdetailPK) {
		TWeatherdetail button =null;
		try {
			button = em.find(TWeatherdetail.class, tWeatherdetailPK);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return button;

	}

}